import java.util.EnumSet;


public class EnumSetExample {

  public static void main(String[] args) {
    EnumSet<Day> week = EnumSet.allOf(Day.class);

    for (Day d : week) {
      System.out.println(d.name());
    }

    System.out.println(week.size());

    week.remove(Day.FRIDAY);
    System.out.println("After removing Day.FRIDAY, size: " + week.size());

    week.add(Day.valueOf("FRIDAY"));
    System.out.println("Size is now: " + week.size());
  }

}
